﻿
namespace NutriLeaf.Web.Services
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Data;
    using System.Linq;
    using System.ServiceModel.DomainServices.EntityFramework;
    using System.ServiceModel.DomainServices.Hosting;
    using System.ServiceModel.DomainServices.Server;
    using NutriLeaf.Web.Model;


    // Implements application logic using the NutriLeafDBEntities context.
    // TODO: Add your application logic to these methods or in additional methods.
    // TODO: Wire up authentication (Windows/ASP.NET Forms) and uncomment the following to disable anonymous access
    // Also consider adding roles to restrict access as appropriate.
    // [RequiresAuthentication]
    [EnableClientAccess()]
    public class NutriLeafDomainService : LinqToEntitiesDomainService<NutriLeafDBEntities>
    {

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'ActivityLevels' query.
        [Query(IsDefault = true)]
        public IQueryable<ActivityLevel> GetActivityLevels()
        {
            return this.ObjectContext.ActivityLevels;
        }

        public void InsertActivityLevel(ActivityLevel activityLevel)
        {
            if ((activityLevel.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(activityLevel, EntityState.Added);
            }
            else
            {
                this.ObjectContext.ActivityLevels.AddObject(activityLevel);
            }
        }

        public void UpdateActivityLevel(ActivityLevel currentActivityLevel)
        {
            this.ObjectContext.ActivityLevels.AttachAsModified(currentActivityLevel, this.ChangeSet.GetOriginal(currentActivityLevel));
        }

        public void DeleteActivityLevel(ActivityLevel activityLevel)
        {
            if ((activityLevel.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(activityLevel, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.ActivityLevels.Attach(activityLevel);
                this.ObjectContext.ActivityLevels.DeleteObject(activityLevel);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Articles' query.
        [Query(IsDefault = true)]
        public IQueryable<Article> GetArticles()
        {
            return this.ObjectContext.Articles;
        }

        public void InsertArticle(Article article)
        {
            if ((article.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(article, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Articles.AddObject(article);
            }
        }

        public void UpdateArticle(Article currentArticle)
        {
            this.ObjectContext.Articles.AttachAsModified(currentArticle, this.ChangeSet.GetOriginal(currentArticle));
        }

        public void DeleteArticle(Article article)
        {
            if ((article.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(article, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Articles.Attach(article);
                this.ObjectContext.Articles.DeleteObject(article);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'ArticleCategories' query.
        [Query(IsDefault = true)]
        public IQueryable<ArticleCategory> GetArticleCategories()
        {
            return this.ObjectContext.ArticleCategories;
        }

        public void InsertArticleCategory(ArticleCategory articleCategory)
        {
            if ((articleCategory.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(articleCategory, EntityState.Added);
            }
            else
            {
                this.ObjectContext.ArticleCategories.AddObject(articleCategory);
            }
        }

        public void UpdateArticleCategory(ArticleCategory currentArticleCategory)
        {
            this.ObjectContext.ArticleCategories.AttachAsModified(currentArticleCategory, this.ChangeSet.GetOriginal(currentArticleCategory));
        }

        public void DeleteArticleCategory(ArticleCategory articleCategory)
        {
            if ((articleCategory.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(articleCategory, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.ArticleCategories.Attach(articleCategory);
                this.ObjectContext.ArticleCategories.DeleteObject(articleCategory);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'ArticleLikes' query.
        [Query(IsDefault = true)]
        public IQueryable<ArticleLike> GetArticleLikes()
        {
            return this.ObjectContext.ArticleLikes;
        }

        public void InsertArticleLike(ArticleLike articleLike)
        {
            if ((articleLike.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(articleLike, EntityState.Added);
            }
            else
            {
                this.ObjectContext.ArticleLikes.AddObject(articleLike);
            }
        }

        public void UpdateArticleLike(ArticleLike currentArticleLike)
        {
            this.ObjectContext.ArticleLikes.AttachAsModified(currentArticleLike, this.ChangeSet.GetOriginal(currentArticleLike));
        }

        public void DeleteArticleLike(ArticleLike articleLike)
        {
            if ((articleLike.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(articleLike, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.ArticleLikes.Attach(articleLike);
                this.ObjectContext.ArticleLikes.DeleteObject(articleLike);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Barcodes' query.
        [Query(IsDefault = true)]
        public IQueryable<Barcode> GetBarcodes()
        {
            return this.ObjectContext.Barcodes;
        }

        public void InsertBarcode(Barcode barcode)
        {
            if ((barcode.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(barcode, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Barcodes.AddObject(barcode);
            }
        }

        public void UpdateBarcode(Barcode currentBarcode)
        {
            this.ObjectContext.Barcodes.AttachAsModified(currentBarcode, this.ChangeSet.GetOriginal(currentBarcode));
        }

        public void DeleteBarcode(Barcode barcode)
        {
            if ((barcode.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(barcode, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Barcodes.Attach(barcode);
                this.ObjectContext.Barcodes.DeleteObject(barcode);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'BarcodeInFoodIngredients' query.
        [Query(IsDefault = true)]
        public IQueryable<BarcodeInFoodIngredient> GetBarcodeInFoodIngredients()
        {
            return this.ObjectContext.BarcodeInFoodIngredients;
        }

        public void InsertBarcodeInFoodIngredient(BarcodeInFoodIngredient barcodeInFoodIngredient)
        {
            if ((barcodeInFoodIngredient.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(barcodeInFoodIngredient, EntityState.Added);
            }
            else
            {
                this.ObjectContext.BarcodeInFoodIngredients.AddObject(barcodeInFoodIngredient);
            }
        }

        public void UpdateBarcodeInFoodIngredient(BarcodeInFoodIngredient currentBarcodeInFoodIngredient)
        {
            this.ObjectContext.BarcodeInFoodIngredients.AttachAsModified(currentBarcodeInFoodIngredient, this.ChangeSet.GetOriginal(currentBarcodeInFoodIngredient));
        }

        public void DeleteBarcodeInFoodIngredient(BarcodeInFoodIngredient barcodeInFoodIngredient)
        {
            if ((barcodeInFoodIngredient.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(barcodeInFoodIngredient, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.BarcodeInFoodIngredients.Attach(barcodeInFoodIngredient);
                this.ObjectContext.BarcodeInFoodIngredients.DeleteObject(barcodeInFoodIngredient);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'BarcodeTypes' query.
        [Query(IsDefault = true)]
        public IQueryable<BarcodeType> GetBarcodeTypes()
        {
            return this.ObjectContext.BarcodeTypes;
        }

        public void InsertBarcodeType(BarcodeType barcodeType)
        {
            if ((barcodeType.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(barcodeType, EntityState.Added);
            }
            else
            {
                this.ObjectContext.BarcodeTypes.AddObject(barcodeType);
            }
        }

        public void UpdateBarcodeType(BarcodeType currentBarcodeType)
        {
            this.ObjectContext.BarcodeTypes.AttachAsModified(currentBarcodeType, this.ChangeSet.GetOriginal(currentBarcodeType));
        }

        public void DeleteBarcodeType(BarcodeType barcodeType)
        {
            if ((barcodeType.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(barcodeType, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.BarcodeTypes.Attach(barcodeType);
                this.ObjectContext.BarcodeTypes.DeleteObject(barcodeType);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'C__RefactorLog' query.
        [Query(IsDefault = true)]
        public IQueryable<C__RefactorLog> GetC__RefactorLog()
        {
            return this.ObjectContext.C__RefactorLog;
        }

        public void InsertC__RefactorLog(C__RefactorLog c__RefactorLog)
        {
            if ((c__RefactorLog.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(c__RefactorLog, EntityState.Added);
            }
            else
            {
                this.ObjectContext.C__RefactorLog.AddObject(c__RefactorLog);
            }
        }

        public void UpdateC__RefactorLog(C__RefactorLog currentC__RefactorLog)
        {
            this.ObjectContext.C__RefactorLog.AttachAsModified(currentC__RefactorLog, this.ChangeSet.GetOriginal(currentC__RefactorLog));
        }

        public void DeleteC__RefactorLog(C__RefactorLog c__RefactorLog)
        {
            if ((c__RefactorLog.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(c__RefactorLog, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.C__RefactorLog.Attach(c__RefactorLog);
                this.ObjectContext.C__RefactorLog.DeleteObject(c__RefactorLog);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'CalorieDiaries' query.
        [Query(IsDefault = true)]
        public IQueryable<CalorieDiary> GetCalorieDiaries()
        {
            return this.ObjectContext.CalorieDiaries;
        }

        public void InsertCalorieDiary(CalorieDiary calorieDiary)
        {
            if ((calorieDiary.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(calorieDiary, EntityState.Added);
            }
            else
            {
                this.ObjectContext.CalorieDiaries.AddObject(calorieDiary);
            }
        }

        public void UpdateCalorieDiary(CalorieDiary currentCalorieDiary)
        {
            this.ObjectContext.CalorieDiaries.AttachAsModified(currentCalorieDiary, this.ChangeSet.GetOriginal(currentCalorieDiary));
        }

        public void DeleteCalorieDiary(CalorieDiary calorieDiary)
        {
            if ((calorieDiary.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(calorieDiary, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.CalorieDiaries.Attach(calorieDiary);
                this.ObjectContext.CalorieDiaries.DeleteObject(calorieDiary);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Cities' query.
        [Query(IsDefault = true)]
        public IQueryable<City> GetCities()
        {
            return this.ObjectContext.Cities;
        }

        public void InsertCity(City city)
        {
            if ((city.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(city, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Cities.AddObject(city);
            }
        }

        public void UpdateCity(City currentCity)
        {
            this.ObjectContext.Cities.AttachAsModified(currentCity, this.ChangeSet.GetOriginal(currentCity));
        }

        public void DeleteCity(City city)
        {
            if ((city.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(city, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Cities.Attach(city);
                this.ObjectContext.Cities.DeleteObject(city);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Countries' query.
        [Query(IsDefault = true)]
        public IQueryable<Country> GetCountries()
        {
            return this.ObjectContext.Countries;
        }

        public void InsertCountry(Country country)
        {
            if ((country.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(country, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Countries.AddObject(country);
            }
        }

        public void UpdateCountry(Country currentCountry)
        {
            this.ObjectContext.Countries.AttachAsModified(currentCountry, this.ChangeSet.GetOriginal(currentCountry));
        }

        public void DeleteCountry(Country country)
        {
            if ((country.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(country, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Countries.Attach(country);
                this.ObjectContext.Countries.DeleteObject(country);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'DoctorClinics' query.
        [Query(IsDefault = true)]
        public IQueryable<DoctorClinic> GetDoctorClinics()
        {
            return this.ObjectContext.DoctorClinics;
        }

        public void InsertDoctorClinic(DoctorClinic doctorClinic)
        {
            if ((doctorClinic.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(doctorClinic, EntityState.Added);
            }
            else
            {
                this.ObjectContext.DoctorClinics.AddObject(doctorClinic);
            }
        }

        public void UpdateDoctorClinic(DoctorClinic currentDoctorClinic)
        {
            this.ObjectContext.DoctorClinics.AttachAsModified(currentDoctorClinic, this.ChangeSet.GetOriginal(currentDoctorClinic));
        }

        public void DeleteDoctorClinic(DoctorClinic doctorClinic)
        {
            if ((doctorClinic.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(doctorClinic, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.DoctorClinics.Attach(doctorClinic);
                this.ObjectContext.DoctorClinics.DeleteObject(doctorClinic);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'DoctorClinicAppointments' query.
        [Query(IsDefault = true)]
        public IQueryable<DoctorClinicAppointment> GetDoctorClinicAppointments()
        {
            return this.ObjectContext.DoctorClinicAppointments;
        }

        public void InsertDoctorClinicAppointment(DoctorClinicAppointment doctorClinicAppointment)
        {
            if ((doctorClinicAppointment.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(doctorClinicAppointment, EntityState.Added);
            }
            else
            {
                this.ObjectContext.DoctorClinicAppointments.AddObject(doctorClinicAppointment);
            }
        }

        public void UpdateDoctorClinicAppointment(DoctorClinicAppointment currentDoctorClinicAppointment)
        {
            this.ObjectContext.DoctorClinicAppointments.AttachAsModified(currentDoctorClinicAppointment, this.ChangeSet.GetOriginal(currentDoctorClinicAppointment));
        }

        public void DeleteDoctorClinicAppointment(DoctorClinicAppointment doctorClinicAppointment)
        {
            if ((doctorClinicAppointment.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(doctorClinicAppointment, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.DoctorClinicAppointments.Attach(doctorClinicAppointment);
                this.ObjectContext.DoctorClinicAppointments.DeleteObject(doctorClinicAppointment);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'DoctorInDoctorClinics' query.
        [Query(IsDefault = true)]
        public IQueryable<DoctorInDoctorClinic> GetDoctorInDoctorClinics()
        {
            return this.ObjectContext.DoctorInDoctorClinics;
        }

        public void InsertDoctorInDoctorClinic(DoctorInDoctorClinic doctorInDoctorClinic)
        {
            if ((doctorInDoctorClinic.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(doctorInDoctorClinic, EntityState.Added);
            }
            else
            {
                this.ObjectContext.DoctorInDoctorClinics.AddObject(doctorInDoctorClinic);
            }
        }

        public void UpdateDoctorInDoctorClinic(DoctorInDoctorClinic currentDoctorInDoctorClinic)
        {
            this.ObjectContext.DoctorInDoctorClinics.AttachAsModified(currentDoctorInDoctorClinic, this.ChangeSet.GetOriginal(currentDoctorInDoctorClinic));
        }

        public void DeleteDoctorInDoctorClinic(DoctorInDoctorClinic doctorInDoctorClinic)
        {
            if ((doctorInDoctorClinic.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(doctorInDoctorClinic, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.DoctorInDoctorClinics.Attach(doctorInDoctorClinic);
                this.ObjectContext.DoctorInDoctorClinics.DeleteObject(doctorInDoctorClinic);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'DoctorProfiles' query.
        [Query(IsDefault = true)]
        public IQueryable<DoctorProfile> GetDoctorProfiles()
        {
            return this.ObjectContext.DoctorProfiles;
        }

        public void InsertDoctorProfile(DoctorProfile doctorProfile)
        {
            if ((doctorProfile.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(doctorProfile, EntityState.Added);
            }
            else
            {
                this.ObjectContext.DoctorProfiles.AddObject(doctorProfile);
            }
        }

        public void UpdateDoctorProfile(DoctorProfile currentDoctorProfile)
        {
            this.ObjectContext.DoctorProfiles.AttachAsModified(currentDoctorProfile, this.ChangeSet.GetOriginal(currentDoctorProfile));
        }

        public void DeleteDoctorProfile(DoctorProfile doctorProfile)
        {
            if ((doctorProfile.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(doctorProfile, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.DoctorProfiles.Attach(doctorProfile);
                this.ObjectContext.DoctorProfiles.DeleteObject(doctorProfile);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'DoctorTypes' query.
        [Query(IsDefault = true)]
        public IQueryable<DoctorType> GetDoctorTypes()
        {
            return this.ObjectContext.DoctorTypes;
        }

        public void InsertDoctorType(DoctorType doctorType)
        {
            if ((doctorType.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(doctorType, EntityState.Added);
            }
            else
            {
                this.ObjectContext.DoctorTypes.AddObject(doctorType);
            }
        }

        public void UpdateDoctorType(DoctorType currentDoctorType)
        {
            this.ObjectContext.DoctorTypes.AttachAsModified(currentDoctorType, this.ChangeSet.GetOriginal(currentDoctorType));
        }

        public void DeleteDoctorType(DoctorType doctorType)
        {
            if ((doctorType.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(doctorType, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.DoctorTypes.Attach(doctorType);
                this.ObjectContext.DoctorTypes.DeleteObject(doctorType);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Exercises' query.
        [Query(IsDefault = true)]
        public IQueryable<Exercise> GetExercises()
        {
            return this.ObjectContext.Exercises;
        }

        public void InsertExercise(Exercise exercise)
        {
            if ((exercise.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(exercise, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Exercises.AddObject(exercise);
            }
        }

        public void UpdateExercise(Exercise currentExercise)
        {
            this.ObjectContext.Exercises.AttachAsModified(currentExercise, this.ChangeSet.GetOriginal(currentExercise));
        }

        public void DeleteExercise(Exercise exercise)
        {
            if ((exercise.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(exercise, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Exercises.Attach(exercise);
                this.ObjectContext.Exercises.DeleteObject(exercise);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'ExerciseTypes' query.
        [Query(IsDefault = true)]
        public IQueryable<ExerciseType> GetExerciseTypes()
        {
            return this.ObjectContext.ExerciseTypes;
        }

        public void InsertExerciseType(ExerciseType exerciseType)
        {
            if ((exerciseType.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(exerciseType, EntityState.Added);
            }
            else
            {
                this.ObjectContext.ExerciseTypes.AddObject(exerciseType);
            }
        }

        public void UpdateExerciseType(ExerciseType currentExerciseType)
        {
            this.ObjectContext.ExerciseTypes.AttachAsModified(currentExerciseType, this.ChangeSet.GetOriginal(currentExerciseType));
        }

        public void DeleteExerciseType(ExerciseType exerciseType)
        {
            if ((exerciseType.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(exerciseType, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.ExerciseTypes.Attach(exerciseType);
                this.ObjectContext.ExerciseTypes.DeleteObject(exerciseType);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'FluidDiaries' query.
        [Query(IsDefault = true)]
        public IQueryable<FluidDiary> GetFluidDiaries()
        {
            return this.ObjectContext.FluidDiaries;
        }

        public void InsertFluidDiary(FluidDiary fluidDiary)
        {
            if ((fluidDiary.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(fluidDiary, EntityState.Added);
            }
            else
            {
                this.ObjectContext.FluidDiaries.AddObject(fluidDiary);
            }
        }

        public void UpdateFluidDiary(FluidDiary currentFluidDiary)
        {
            this.ObjectContext.FluidDiaries.AttachAsModified(currentFluidDiary, this.ChangeSet.GetOriginal(currentFluidDiary));
        }

        public void DeleteFluidDiary(FluidDiary fluidDiary)
        {
            if ((fluidDiary.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(fluidDiary, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.FluidDiaries.Attach(fluidDiary);
                this.ObjectContext.FluidDiaries.DeleteObject(fluidDiary);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Foods' query.
        [Query(IsDefault = true)]
        public IQueryable<Food> GetFoods()
        {
            return this.ObjectContext.Foods;
        }

        public void InsertFood(Food food)
        {
            if ((food.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(food, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Foods.AddObject(food);
            }
        }

        public void UpdateFood(Food currentFood)
        {
            this.ObjectContext.Foods.AttachAsModified(currentFood, this.ChangeSet.GetOriginal(currentFood));
        }

        public void DeleteFood(Food food)
        {
            if ((food.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(food, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Foods.Attach(food);
                this.ObjectContext.Foods.DeleteObject(food);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'FoodBrands' query.
        [Query(IsDefault = true)]
        public IQueryable<FoodBrand> GetFoodBrands()
        {
            return this.ObjectContext.FoodBrands;
        }

        public void InsertFoodBrand(FoodBrand foodBrand)
        {
            if ((foodBrand.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(foodBrand, EntityState.Added);
            }
            else
            {
                this.ObjectContext.FoodBrands.AddObject(foodBrand);
            }
        }

        public void UpdateFoodBrand(FoodBrand currentFoodBrand)
        {
            this.ObjectContext.FoodBrands.AttachAsModified(currentFoodBrand, this.ChangeSet.GetOriginal(currentFoodBrand));
        }

        public void DeleteFoodBrand(FoodBrand foodBrand)
        {
            if ((foodBrand.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(foodBrand, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.FoodBrands.Attach(foodBrand);
                this.ObjectContext.FoodBrands.DeleteObject(foodBrand);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'FoodCategories' query.
        [Query(IsDefault = true)]
        public IQueryable<FoodCategory> GetFoodCategories()
        {
            return this.ObjectContext.FoodCategories;
        }

        public void InsertFoodCategory(FoodCategory foodCategory)
        {
            if ((foodCategory.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(foodCategory, EntityState.Added);
            }
            else
            {
                this.ObjectContext.FoodCategories.AddObject(foodCategory);
            }
        }

        public void UpdateFoodCategory(FoodCategory currentFoodCategory)
        {
            this.ObjectContext.FoodCategories.AttachAsModified(currentFoodCategory, this.ChangeSet.GetOriginal(currentFoodCategory));
        }

        public void DeleteFoodCategory(FoodCategory foodCategory)
        {
            if ((foodCategory.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(foodCategory, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.FoodCategories.Attach(foodCategory);
                this.ObjectContext.FoodCategories.DeleteObject(foodCategory);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'FoodCountries' query.
        [Query(IsDefault = true)]
        public IQueryable<FoodCountry> GetFoodCountries()
        {
            return this.ObjectContext.FoodCountries;
        }

        public void InsertFoodCountry(FoodCountry foodCountry)
        {
            if ((foodCountry.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(foodCountry, EntityState.Added);
            }
            else
            {
                this.ObjectContext.FoodCountries.AddObject(foodCountry);
            }
        }

        public void UpdateFoodCountry(FoodCountry currentFoodCountry)
        {
            this.ObjectContext.FoodCountries.AttachAsModified(currentFoodCountry, this.ChangeSet.GetOriginal(currentFoodCountry));
        }

        public void DeleteFoodCountry(FoodCountry foodCountry)
        {
            if ((foodCountry.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(foodCountry, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.FoodCountries.Attach(foodCountry);
                this.ObjectContext.FoodCountries.DeleteObject(foodCountry);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'FoodDiaries' query.
        [Query(IsDefault = true)]
        public IQueryable<FoodDiary> GetFoodDiaries()
        {
            return this.ObjectContext.FoodDiaries;
        }

        public void InsertFoodDiary(FoodDiary foodDiary)
        {
            if ((foodDiary.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(foodDiary, EntityState.Added);
            }
            else
            {
                this.ObjectContext.FoodDiaries.AddObject(foodDiary);
            }
        }

        public void UpdateFoodDiary(FoodDiary currentFoodDiary)
        {
            this.ObjectContext.FoodDiaries.AttachAsModified(currentFoodDiary, this.ChangeSet.GetOriginal(currentFoodDiary));
        }

        public void DeleteFoodDiary(FoodDiary foodDiary)
        {
            if ((foodDiary.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(foodDiary, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.FoodDiaries.Attach(foodDiary);
                this.ObjectContext.FoodDiaries.DeleteObject(foodDiary);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'FoodInFoodCategories' query.
        [Query(IsDefault = true)]
        public IQueryable<FoodInFoodCategory> GetFoodInFoodCategories()
        {
            return this.ObjectContext.FoodInFoodCategories;
        }

        public void InsertFoodInFoodCategory(FoodInFoodCategory foodInFoodCategory)
        {
            if ((foodInFoodCategory.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(foodInFoodCategory, EntityState.Added);
            }
            else
            {
                this.ObjectContext.FoodInFoodCategories.AddObject(foodInFoodCategory);
            }
        }

        public void UpdateFoodInFoodCategory(FoodInFoodCategory currentFoodInFoodCategory)
        {
            this.ObjectContext.FoodInFoodCategories.AttachAsModified(currentFoodInFoodCategory, this.ChangeSet.GetOriginal(currentFoodInFoodCategory));
        }

        public void DeleteFoodInFoodCategory(FoodInFoodCategory foodInFoodCategory)
        {
            if ((foodInFoodCategory.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(foodInFoodCategory, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.FoodInFoodCategories.Attach(foodInFoodCategory);
                this.ObjectContext.FoodInFoodCategories.DeleteObject(foodInFoodCategory);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'FoodIngredients' query.
        [Query(IsDefault = true)]
        public IQueryable<FoodIngredient> GetFoodIngredients()
        {
            return this.ObjectContext.FoodIngredients;
        }

        public void InsertFoodIngredient(FoodIngredient foodIngredient)
        {
            if ((foodIngredient.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(foodIngredient, EntityState.Added);
            }
            else
            {
                this.ObjectContext.FoodIngredients.AddObject(foodIngredient);
            }
        }

        public void UpdateFoodIngredient(FoodIngredient currentFoodIngredient)
        {
            this.ObjectContext.FoodIngredients.AttachAsModified(currentFoodIngredient, this.ChangeSet.GetOriginal(currentFoodIngredient));
        }

        public void DeleteFoodIngredient(FoodIngredient foodIngredient)
        {
            if ((foodIngredient.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(foodIngredient, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.FoodIngredients.Attach(foodIngredient);
                this.ObjectContext.FoodIngredients.DeleteObject(foodIngredient);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'FoodIngredientsInFoods' query.
        [Query(IsDefault = true)]
        public IQueryable<FoodIngredientsInFood> GetFoodIngredientsInFoods()
        {
            return this.ObjectContext.FoodIngredientsInFoods;
        }

        public void InsertFoodIngredientsInFood(FoodIngredientsInFood foodIngredientsInFood)
        {
            if ((foodIngredientsInFood.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(foodIngredientsInFood, EntityState.Added);
            }
            else
            {
                this.ObjectContext.FoodIngredientsInFoods.AddObject(foodIngredientsInFood);
            }
        }

        public void UpdateFoodIngredientsInFood(FoodIngredientsInFood currentFoodIngredientsInFood)
        {
            this.ObjectContext.FoodIngredientsInFoods.AttachAsModified(currentFoodIngredientsInFood, this.ChangeSet.GetOriginal(currentFoodIngredientsInFood));
        }

        public void DeleteFoodIngredientsInFood(FoodIngredientsInFood foodIngredientsInFood)
        {
            if ((foodIngredientsInFood.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(foodIngredientsInFood, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.FoodIngredientsInFoods.Attach(foodIngredientsInFood);
                this.ObjectContext.FoodIngredientsInFoods.DeleteObject(foodIngredientsInFood);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'FoodInMeals' query.
        [Query(IsDefault = true)]
        public IQueryable<FoodInMeal> GetFoodInMeals()
        {
            return this.ObjectContext.FoodInMeals;
        }

        public void InsertFoodInMeal(FoodInMeal foodInMeal)
        {
            if ((foodInMeal.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(foodInMeal, EntityState.Added);
            }
            else
            {
                this.ObjectContext.FoodInMeals.AddObject(foodInMeal);
            }
        }

        public void UpdateFoodInMeal(FoodInMeal currentFoodInMeal)
        {
            this.ObjectContext.FoodInMeals.AttachAsModified(currentFoodInMeal, this.ChangeSet.GetOriginal(currentFoodInMeal));
        }

        public void DeleteFoodInMeal(FoodInMeal foodInMeal)
        {
            if ((foodInMeal.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(foodInMeal, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.FoodInMeals.Attach(foodInMeal);
                this.ObjectContext.FoodInMeals.DeleteObject(foodInMeal);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'FoodInPregnancies' query.
        [Query(IsDefault = true)]
        public IQueryable<FoodInPregnancy> GetFoodInPregnancies()
        {
            return this.ObjectContext.FoodInPregnancies;
        }

        public void InsertFoodInPregnancy(FoodInPregnancy foodInPregnancy)
        {
            if ((foodInPregnancy.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(foodInPregnancy, EntityState.Added);
            }
            else
            {
                this.ObjectContext.FoodInPregnancies.AddObject(foodInPregnancy);
            }
        }

        public void UpdateFoodInPregnancy(FoodInPregnancy currentFoodInPregnancy)
        {
            this.ObjectContext.FoodInPregnancies.AttachAsModified(currentFoodInPregnancy, this.ChangeSet.GetOriginal(currentFoodInPregnancy));
        }

        public void DeleteFoodInPregnancy(FoodInPregnancy foodInPregnancy)
        {
            if ((foodInPregnancy.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(foodInPregnancy, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.FoodInPregnancies.Attach(foodInPregnancy);
                this.ObjectContext.FoodInPregnancies.DeleteObject(foodInPregnancy);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'FoodLikes' query.
        [Query(IsDefault = true)]
        public IQueryable<FoodLike> GetFoodLikes()
        {
            return this.ObjectContext.FoodLikes;
        }

        public void InsertFoodLike(FoodLike foodLike)
        {
            if ((foodLike.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(foodLike, EntityState.Added);
            }
            else
            {
                this.ObjectContext.FoodLikes.AddObject(foodLike);
            }
        }

        public void UpdateFoodLike(FoodLike currentFoodLike)
        {
            this.ObjectContext.FoodLikes.AttachAsModified(currentFoodLike, this.ChangeSet.GetOriginal(currentFoodLike));
        }

        public void DeleteFoodLike(FoodLike foodLike)
        {
            if ((foodLike.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(foodLike, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.FoodLikes.Attach(foodLike);
                this.ObjectContext.FoodLikes.DeleteObject(foodLike);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'FoodServings' query.
        [Query(IsDefault = true)]
        public IQueryable<FoodServing> GetFoodServings()
        {
            return this.ObjectContext.FoodServings;
        }

        public void InsertFoodServing(FoodServing foodServing)
        {
            if ((foodServing.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(foodServing, EntityState.Added);
            }
            else
            {
                this.ObjectContext.FoodServings.AddObject(foodServing);
            }
        }

        public void UpdateFoodServing(FoodServing currentFoodServing)
        {
            this.ObjectContext.FoodServings.AttachAsModified(currentFoodServing, this.ChangeSet.GetOriginal(currentFoodServing));
        }

        public void DeleteFoodServing(FoodServing foodServing)
        {
            if ((foodServing.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(foodServing, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.FoodServings.Attach(foodServing);
                this.ObjectContext.FoodServings.DeleteObject(foodServing);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'FoodTemperatures' query.
        [Query(IsDefault = true)]
        public IQueryable<FoodTemperature> GetFoodTemperatures()
        {
            return this.ObjectContext.FoodTemperatures;
        }

        public void InsertFoodTemperature(FoodTemperature foodTemperature)
        {
            if ((foodTemperature.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(foodTemperature, EntityState.Added);
            }
            else
            {
                this.ObjectContext.FoodTemperatures.AddObject(foodTemperature);
            }
        }

        public void UpdateFoodTemperature(FoodTemperature currentFoodTemperature)
        {
            this.ObjectContext.FoodTemperatures.AttachAsModified(currentFoodTemperature, this.ChangeSet.GetOriginal(currentFoodTemperature));
        }

        public void DeleteFoodTemperature(FoodTemperature foodTemperature)
        {
            if ((foodTemperature.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(foodTemperature, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.FoodTemperatures.Attach(foodTemperature);
                this.ObjectContext.FoodTemperatures.DeleteObject(foodTemperature);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'FoodTimes' query.
        [Query(IsDefault = true)]
        public IQueryable<FoodTime> GetFoodTimes()
        {
            return this.ObjectContext.FoodTimes;
        }

        public void InsertFoodTime(FoodTime foodTime)
        {
            if ((foodTime.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(foodTime, EntityState.Added);
            }
            else
            {
                this.ObjectContext.FoodTimes.AddObject(foodTime);
            }
        }

        public void UpdateFoodTime(FoodTime currentFoodTime)
        {
            this.ObjectContext.FoodTimes.AttachAsModified(currentFoodTime, this.ChangeSet.GetOriginal(currentFoodTime));
        }

        public void DeleteFoodTime(FoodTime foodTime)
        {
            if ((foodTime.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(foodTime, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.FoodTimes.Attach(foodTime);
                this.ObjectContext.FoodTimes.DeleteObject(foodTime);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'ForumThreads' query.
        [Query(IsDefault = true)]
        public IQueryable<ForumThread> GetForumThreads()
        {
            return this.ObjectContext.ForumThreads;
        }

        public void InsertForumThread(ForumThread forumThread)
        {
            if ((forumThread.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(forumThread, EntityState.Added);
            }
            else
            {
                this.ObjectContext.ForumThreads.AddObject(forumThread);
            }
        }

        public void UpdateForumThread(ForumThread currentForumThread)
        {
            this.ObjectContext.ForumThreads.AttachAsModified(currentForumThread, this.ChangeSet.GetOriginal(currentForumThread));
        }

        public void DeleteForumThread(ForumThread forumThread)
        {
            if ((forumThread.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(forumThread, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.ForumThreads.Attach(forumThread);
                this.ObjectContext.ForumThreads.DeleteObject(forumThread);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'ForumThreadReplyIDs' query.
        [Query(IsDefault = true)]
        public IQueryable<ForumThreadReplyID> GetForumThreadReplyIDs()
        {
            return this.ObjectContext.ForumThreadReplyIDs;
        }

        public void InsertForumThreadReplyID(ForumThreadReplyID forumThreadReplyID)
        {
            if ((forumThreadReplyID.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(forumThreadReplyID, EntityState.Added);
            }
            else
            {
                this.ObjectContext.ForumThreadReplyIDs.AddObject(forumThreadReplyID);
            }
        }

        public void UpdateForumThreadReplyID(ForumThreadReplyID currentForumThreadReplyID)
        {
            this.ObjectContext.ForumThreadReplyIDs.AttachAsModified(currentForumThreadReplyID, this.ChangeSet.GetOriginal(currentForumThreadReplyID));
        }

        public void DeleteForumThreadReplyID(ForumThreadReplyID forumThreadReplyID)
        {
            if ((forumThreadReplyID.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(forumThreadReplyID, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.ForumThreadReplyIDs.Attach(forumThreadReplyID);
                this.ObjectContext.ForumThreadReplyIDs.DeleteObject(forumThreadReplyID);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Friends' query.
        [Query(IsDefault = true)]
        public IQueryable<Friend> GetFriends()
        {
            return this.ObjectContext.Friends;
        }

        public void InsertFriend(Friend friend)
        {
            if ((friend.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(friend, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Friends.AddObject(friend);
            }
        }

        public void UpdateFriend(Friend currentFriend)
        {
            this.ObjectContext.Friends.AttachAsModified(currentFriend, this.ChangeSet.GetOriginal(currentFriend));
        }

        public void DeleteFriend(Friend friend)
        {
            if ((friend.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(friend, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Friends.Attach(friend);
                this.ObjectContext.Friends.DeleteObject(friend);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'HealthRatings' query.
        [Query(IsDefault = true)]
        public IQueryable<HealthRating> GetHealthRatings()
        {
            return this.ObjectContext.HealthRatings;
        }

        public void InsertHealthRating(HealthRating healthRating)
        {
            if ((healthRating.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(healthRating, EntityState.Added);
            }
            else
            {
                this.ObjectContext.HealthRatings.AddObject(healthRating);
            }
        }

        public void UpdateHealthRating(HealthRating currentHealthRating)
        {
            this.ObjectContext.HealthRatings.AttachAsModified(currentHealthRating, this.ChangeSet.GetOriginal(currentHealthRating));
        }

        public void DeleteHealthRating(HealthRating healthRating)
        {
            if ((healthRating.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(healthRating, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.HealthRatings.Attach(healthRating);
                this.ObjectContext.HealthRatings.DeleteObject(healthRating);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Images' query.
        [Query(IsDefault = true)]
        public IQueryable<Image> GetImages()
        {
            return this.ObjectContext.Images;
        }

        public void InsertImage(Image image)
        {
            if ((image.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(image, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Images.AddObject(image);
            }
        }

        public void UpdateImage(Image currentImage)
        {
            this.ObjectContext.Images.AttachAsModified(currentImage, this.ChangeSet.GetOriginal(currentImage));
        }

        public void DeleteImage(Image image)
        {
            if ((image.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(image, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Images.Attach(image);
                this.ObjectContext.Images.DeleteObject(image);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'IngredientsAtHomes' query.
        [Query(IsDefault = true)]
        public IQueryable<IngredientsAtHome> GetIngredientsAtHomes()
        {
            return this.ObjectContext.IngredientsAtHomes;
        }

        public void InsertIngredientsAtHome(IngredientsAtHome ingredientsAtHome)
        {
            if ((ingredientsAtHome.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(ingredientsAtHome, EntityState.Added);
            }
            else
            {
                this.ObjectContext.IngredientsAtHomes.AddObject(ingredientsAtHome);
            }
        }

        public void UpdateIngredientsAtHome(IngredientsAtHome currentIngredientsAtHome)
        {
            this.ObjectContext.IngredientsAtHomes.AttachAsModified(currentIngredientsAtHome, this.ChangeSet.GetOriginal(currentIngredientsAtHome));
        }

        public void DeleteIngredientsAtHome(IngredientsAtHome ingredientsAtHome)
        {
            if ((ingredientsAtHome.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(ingredientsAtHome, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.IngredientsAtHomes.Attach(ingredientsAtHome);
                this.ObjectContext.IngredientsAtHomes.DeleteObject(ingredientsAtHome);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Locations' query.
        [Query(IsDefault = true)]
        public IQueryable<Location> GetLocations()
        {
            return this.ObjectContext.Locations;
        }

        public void InsertLocation(Location location)
        {
            if ((location.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(location, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Locations.AddObject(location);
            }
        }

        public void UpdateLocation(Location currentLocation)
        {
            this.ObjectContext.Locations.AttachAsModified(currentLocation, this.ChangeSet.GetOriginal(currentLocation));
        }

        public void DeleteLocation(Location location)
        {
            if ((location.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(location, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Locations.Attach(location);
                this.ObjectContext.Locations.DeleteObject(location);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Meals' query.
        [Query(IsDefault = true)]
        public IQueryable<Meal> GetMeals()
        {
            return this.ObjectContext.Meals;
        }

        public void InsertMeal(Meal meal)
        {
            if ((meal.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(meal, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Meals.AddObject(meal);
            }
        }

        public void UpdateMeal(Meal currentMeal)
        {
            this.ObjectContext.Meals.AttachAsModified(currentMeal, this.ChangeSet.GetOriginal(currentMeal));
        }

        public void DeleteMeal(Meal meal)
        {
            if ((meal.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(meal, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Meals.Attach(meal);
                this.ObjectContext.Meals.DeleteObject(meal);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'MealCategories' query.
        [Query(IsDefault = true)]
        public IQueryable<MealCategory> GetMealCategories()
        {
            return this.ObjectContext.MealCategories;
        }

        public void InsertMealCategory(MealCategory mealCategory)
        {
            if ((mealCategory.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(mealCategory, EntityState.Added);
            }
            else
            {
                this.ObjectContext.MealCategories.AddObject(mealCategory);
            }
        }

        public void UpdateMealCategory(MealCategory currentMealCategory)
        {
            this.ObjectContext.MealCategories.AttachAsModified(currentMealCategory, this.ChangeSet.GetOriginal(currentMealCategory));
        }

        public void DeleteMealCategory(MealCategory mealCategory)
        {
            if ((mealCategory.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(mealCategory, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.MealCategories.Attach(mealCategory);
                this.ObjectContext.MealCategories.DeleteObject(mealCategory);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'MealDiaries' query.
        [Query(IsDefault = true)]
        public IQueryable<MealDiary> GetMealDiaries()
        {
            return this.ObjectContext.MealDiaries;
        }

        public void InsertMealDiary(MealDiary mealDiary)
        {
            if ((mealDiary.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(mealDiary, EntityState.Added);
            }
            else
            {
                this.ObjectContext.MealDiaries.AddObject(mealDiary);
            }
        }

        public void UpdateMealDiary(MealDiary currentMealDiary)
        {
            this.ObjectContext.MealDiaries.AttachAsModified(currentMealDiary, this.ChangeSet.GetOriginal(currentMealDiary));
        }

        public void DeleteMealDiary(MealDiary mealDiary)
        {
            if ((mealDiary.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(mealDiary, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.MealDiaries.Attach(mealDiary);
                this.ObjectContext.MealDiaries.DeleteObject(mealDiary);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Messages' query.
        [Query(IsDefault = true)]
        public IQueryable<Message> GetMessages()
        {
            return this.ObjectContext.Messages;
        }

        public void InsertMessage(Message message)
        {
            if ((message.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(message, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Messages.AddObject(message);
            }
        }

        public void UpdateMessage(Message currentMessage)
        {
            this.ObjectContext.Messages.AttachAsModified(currentMessage, this.ChangeSet.GetOriginal(currentMessage));
        }

        public void DeleteMessage(Message message)
        {
            if ((message.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(message, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Messages.Attach(message);
                this.ObjectContext.Messages.DeleteObject(message);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Notifications' query.
        [Query(IsDefault = true)]
        public IQueryable<Notification> GetNotifications()
        {
            return this.ObjectContext.Notifications;
        }

        public void InsertNotification(Notification notification)
        {
            if ((notification.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(notification, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Notifications.AddObject(notification);
            }
        }

        public void UpdateNotification(Notification currentNotification)
        {
            this.ObjectContext.Notifications.AttachAsModified(currentNotification, this.ChangeSet.GetOriginal(currentNotification));
        }

        public void DeleteNotification(Notification notification)
        {
            if ((notification.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(notification, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Notifications.Attach(notification);
                this.ObjectContext.Notifications.DeleteObject(notification);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'NotificationTypes' query.
        [Query(IsDefault = true)]
        public IQueryable<NotificationType> GetNotificationTypes()
        {
            return this.ObjectContext.NotificationTypes;
        }

        public void InsertNotificationType(NotificationType notificationType)
        {
            if ((notificationType.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(notificationType, EntityState.Added);
            }
            else
            {
                this.ObjectContext.NotificationTypes.AddObject(notificationType);
            }
        }

        public void UpdateNotificationType(NotificationType currentNotificationType)
        {
            this.ObjectContext.NotificationTypes.AttachAsModified(currentNotificationType, this.ChangeSet.GetOriginal(currentNotificationType));
        }

        public void DeleteNotificationType(NotificationType notificationType)
        {
            if ((notificationType.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(notificationType, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.NotificationTypes.Attach(notificationType);
                this.ObjectContext.NotificationTypes.DeleteObject(notificationType);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'NutritionInfoes' query.
        [Query(IsDefault = true)]
        public IQueryable<NutritionInfo> GetNutritionInfoes()
        {
            return this.ObjectContext.NutritionInfoes;
        }

        public void InsertNutritionInfo(NutritionInfo nutritionInfo)
        {
            if ((nutritionInfo.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(nutritionInfo, EntityState.Added);
            }
            else
            {
                this.ObjectContext.NutritionInfoes.AddObject(nutritionInfo);
            }
        }

        public void UpdateNutritionInfo(NutritionInfo currentNutritionInfo)
        {
            this.ObjectContext.NutritionInfoes.AttachAsModified(currentNutritionInfo, this.ChangeSet.GetOriginal(currentNutritionInfo));
        }

        public void DeleteNutritionInfo(NutritionInfo nutritionInfo)
        {
            if ((nutritionInfo.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(nutritionInfo, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.NutritionInfoes.Attach(nutritionInfo);
                this.ObjectContext.NutritionInfoes.DeleteObject(nutritionInfo);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Pregnancies' query.
        [Query(IsDefault = true)]
        public IQueryable<Pregnancy> GetPregnancies()
        {
            return this.ObjectContext.Pregnancies;
        }

        public void InsertPregnancy(Pregnancy pregnancy)
        {
            if ((pregnancy.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(pregnancy, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Pregnancies.AddObject(pregnancy);
            }
        }

        public void UpdatePregnancy(Pregnancy currentPregnancy)
        {
            this.ObjectContext.Pregnancies.AttachAsModified(currentPregnancy, this.ChangeSet.GetOriginal(currentPregnancy));
        }

        public void DeletePregnancy(Pregnancy pregnancy)
        {
            if ((pregnancy.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(pregnancy, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Pregnancies.Attach(pregnancy);
                this.ObjectContext.Pregnancies.DeleteObject(pregnancy);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'PregnancyNotifications' query.
        [Query(IsDefault = true)]
        public IQueryable<PregnancyNotification> GetPregnancyNotifications()
        {
            return this.ObjectContext.PregnancyNotifications;
        }

        public void InsertPregnancyNotification(PregnancyNotification pregnancyNotification)
        {
            if ((pregnancyNotification.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(pregnancyNotification, EntityState.Added);
            }
            else
            {
                this.ObjectContext.PregnancyNotifications.AddObject(pregnancyNotification);
            }
        }

        public void UpdatePregnancyNotification(PregnancyNotification currentPregnancyNotification)
        {
            this.ObjectContext.PregnancyNotifications.AttachAsModified(currentPregnancyNotification, this.ChangeSet.GetOriginal(currentPregnancyNotification));
        }

        public void DeletePregnancyNotification(PregnancyNotification pregnancyNotification)
        {
            if ((pregnancyNotification.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(pregnancyNotification, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.PregnancyNotifications.Attach(pregnancyNotification);
                this.ObjectContext.PregnancyNotifications.DeleteObject(pregnancyNotification);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'PregnancyNotificationTypes' query.
        [Query(IsDefault = true)]
        public IQueryable<PregnancyNotificationType> GetPregnancyNotificationTypes()
        {
            return this.ObjectContext.PregnancyNotificationTypes;
        }

        public void InsertPregnancyNotificationType(PregnancyNotificationType pregnancyNotificationType)
        {
            if ((pregnancyNotificationType.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(pregnancyNotificationType, EntityState.Added);
            }
            else
            {
                this.ObjectContext.PregnancyNotificationTypes.AddObject(pregnancyNotificationType);
            }
        }

        public void UpdatePregnancyNotificationType(PregnancyNotificationType currentPregnancyNotificationType)
        {
            this.ObjectContext.PregnancyNotificationTypes.AttachAsModified(currentPregnancyNotificationType, this.ChangeSet.GetOriginal(currentPregnancyNotificationType));
        }

        public void DeletePregnancyNotificationType(PregnancyNotificationType pregnancyNotificationType)
        {
            if ((pregnancyNotificationType.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(pregnancyNotificationType, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.PregnancyNotificationTypes.Attach(pregnancyNotificationType);
                this.ObjectContext.PregnancyNotificationTypes.DeleteObject(pregnancyNotificationType);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'PregnancyProblems' query.
        [Query(IsDefault = true)]
        public IQueryable<PregnancyProblem> GetPregnancyProblems()
        {
            return this.ObjectContext.PregnancyProblems;
        }

        public void InsertPregnancyProblem(PregnancyProblem pregnancyProblem)
        {
            if ((pregnancyProblem.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(pregnancyProblem, EntityState.Added);
            }
            else
            {
                this.ObjectContext.PregnancyProblems.AddObject(pregnancyProblem);
            }
        }

        public void UpdatePregnancyProblem(PregnancyProblem currentPregnancyProblem)
        {
            this.ObjectContext.PregnancyProblems.AttachAsModified(currentPregnancyProblem, this.ChangeSet.GetOriginal(currentPregnancyProblem));
        }

        public void DeletePregnancyProblem(PregnancyProblem pregnancyProblem)
        {
            if ((pregnancyProblem.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(pregnancyProblem, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.PregnancyProblems.Attach(pregnancyProblem);
                this.ObjectContext.PregnancyProblems.DeleteObject(pregnancyProblem);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'PregnancyProblemFoods' query.
        [Query(IsDefault = true)]
        public IQueryable<PregnancyProblemFood> GetPregnancyProblemFoods()
        {
            return this.ObjectContext.PregnancyProblemFoods;
        }

        public void InsertPregnancyProblemFood(PregnancyProblemFood pregnancyProblemFood)
        {
            if ((pregnancyProblemFood.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(pregnancyProblemFood, EntityState.Added);
            }
            else
            {
                this.ObjectContext.PregnancyProblemFoods.AddObject(pregnancyProblemFood);
            }
        }

        public void UpdatePregnancyProblemFood(PregnancyProblemFood currentPregnancyProblemFood)
        {
            this.ObjectContext.PregnancyProblemFoods.AttachAsModified(currentPregnancyProblemFood, this.ChangeSet.GetOriginal(currentPregnancyProblemFood));
        }

        public void DeletePregnancyProblemFood(PregnancyProblemFood pregnancyProblemFood)
        {
            if ((pregnancyProblemFood.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(pregnancyProblemFood, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.PregnancyProblemFoods.Attach(pregnancyProblemFood);
                this.ObjectContext.PregnancyProblemFoods.DeleteObject(pregnancyProblemFood);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'PregnancyWeeks' query.
        [Query(IsDefault = true)]
        public IQueryable<PregnancyWeek> GetPregnancyWeeks()
        {
            return this.ObjectContext.PregnancyWeeks;
        }

        public void InsertPregnancyWeek(PregnancyWeek pregnancyWeek)
        {
            if ((pregnancyWeek.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(pregnancyWeek, EntityState.Added);
            }
            else
            {
                this.ObjectContext.PregnancyWeeks.AddObject(pregnancyWeek);
            }
        }

        public void UpdatePregnancyWeek(PregnancyWeek currentPregnancyWeek)
        {
            this.ObjectContext.PregnancyWeeks.AttachAsModified(currentPregnancyWeek, this.ChangeSet.GetOriginal(currentPregnancyWeek));
        }

        public void DeletePregnancyWeek(PregnancyWeek pregnancyWeek)
        {
            if ((pregnancyWeek.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(pregnancyWeek, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.PregnancyWeeks.Attach(pregnancyWeek);
                this.ObjectContext.PregnancyWeeks.DeleteObject(pregnancyWeek);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'PregnancyWeekImages' query.
        [Query(IsDefault = true)]
        public IQueryable<PregnancyWeekImage> GetPregnancyWeekImages()
        {
            return this.ObjectContext.PregnancyWeekImages;
        }

        public void InsertPregnancyWeekImage(PregnancyWeekImage pregnancyWeekImage)
        {
            if ((pregnancyWeekImage.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(pregnancyWeekImage, EntityState.Added);
            }
            else
            {
                this.ObjectContext.PregnancyWeekImages.AddObject(pregnancyWeekImage);
            }
        }

        public void UpdatePregnancyWeekImage(PregnancyWeekImage currentPregnancyWeekImage)
        {
            this.ObjectContext.PregnancyWeekImages.AttachAsModified(currentPregnancyWeekImage, this.ChangeSet.GetOriginal(currentPregnancyWeekImage));
        }

        public void DeletePregnancyWeekImage(PregnancyWeekImage pregnancyWeekImage)
        {
            if ((pregnancyWeekImage.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(pregnancyWeekImage, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.PregnancyWeekImages.Attach(pregnancyWeekImage);
                this.ObjectContext.PregnancyWeekImages.DeleteObject(pregnancyWeekImage);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'ProfileAnswers' query.
        [Query(IsDefault = true)]
        public IQueryable<ProfileAnswer> GetProfileAnswers()
        {
            return this.ObjectContext.ProfileAnswers;
        }

        public void InsertProfileAnswer(ProfileAnswer profileAnswer)
        {
            if ((profileAnswer.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(profileAnswer, EntityState.Added);
            }
            else
            {
                this.ObjectContext.ProfileAnswers.AddObject(profileAnswer);
            }
        }

        public void UpdateProfileAnswer(ProfileAnswer currentProfileAnswer)
        {
            this.ObjectContext.ProfileAnswers.AttachAsModified(currentProfileAnswer, this.ChangeSet.GetOriginal(currentProfileAnswer));
        }

        public void DeleteProfileAnswer(ProfileAnswer profileAnswer)
        {
            if ((profileAnswer.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(profileAnswer, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.ProfileAnswers.Attach(profileAnswer);
                this.ObjectContext.ProfileAnswers.DeleteObject(profileAnswer);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'ProfileQuestions' query.
        [Query(IsDefault = true)]
        public IQueryable<ProfileQuestion> GetProfileQuestions()
        {
            return this.ObjectContext.ProfileQuestions;
        }

        public void InsertProfileQuestion(ProfileQuestion profileQuestion)
        {
            if ((profileQuestion.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(profileQuestion, EntityState.Added);
            }
            else
            {
                this.ObjectContext.ProfileQuestions.AddObject(profileQuestion);
            }
        }

        public void UpdateProfileQuestion(ProfileQuestion currentProfileQuestion)
        {
            this.ObjectContext.ProfileQuestions.AttachAsModified(currentProfileQuestion, this.ChangeSet.GetOriginal(currentProfileQuestion));
        }

        public void DeleteProfileQuestion(ProfileQuestion profileQuestion)
        {
            if ((profileQuestion.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(profileQuestion, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.ProfileQuestions.Attach(profileQuestion);
                this.ObjectContext.ProfileQuestions.DeleteObject(profileQuestion);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'PushNotifications' query.
        [Query(IsDefault = true)]
        public IQueryable<PushNotification> GetPushNotifications()
        {
            return this.ObjectContext.PushNotifications;
        }

        public void InsertPushNotification(PushNotification pushNotification)
        {
            if ((pushNotification.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(pushNotification, EntityState.Added);
            }
            else
            {
                this.ObjectContext.PushNotifications.AddObject(pushNotification);
            }
        }

        public void UpdatePushNotification(PushNotification currentPushNotification)
        {
            this.ObjectContext.PushNotifications.AttachAsModified(currentPushNotification, this.ChangeSet.GetOriginal(currentPushNotification));
        }

        public void DeletePushNotification(PushNotification pushNotification)
        {
            if ((pushNotification.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(pushNotification, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.PushNotifications.Attach(pushNotification);
                this.ObjectContext.PushNotifications.DeleteObject(pushNotification);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Recipes' query.
        [Query(IsDefault = true)]
        public IQueryable<Recipe> GetRecipes()
        {
            return this.ObjectContext.Recipes;
        }

        public void InsertRecipe(Recipe recipe)
        {
            if ((recipe.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(recipe, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Recipes.AddObject(recipe);
            }
        }

        public void UpdateRecipe(Recipe currentRecipe)
        {
            this.ObjectContext.Recipes.AttachAsModified(currentRecipe, this.ChangeSet.GetOriginal(currentRecipe));
        }

        public void DeleteRecipe(Recipe recipe)
        {
            if ((recipe.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(recipe, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Recipes.Attach(recipe);
                this.ObjectContext.Recipes.DeleteObject(recipe);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'RecipeCategories' query.
        [Query(IsDefault = true)]
        public IQueryable<RecipeCategory> GetRecipeCategories()
        {
            return this.ObjectContext.RecipeCategories;
        }

        public void InsertRecipeCategory(RecipeCategory recipeCategory)
        {
            if ((recipeCategory.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(recipeCategory, EntityState.Added);
            }
            else
            {
                this.ObjectContext.RecipeCategories.AddObject(recipeCategory);
            }
        }

        public void UpdateRecipeCategory(RecipeCategory currentRecipeCategory)
        {
            this.ObjectContext.RecipeCategories.AttachAsModified(currentRecipeCategory, this.ChangeSet.GetOriginal(currentRecipeCategory));
        }

        public void DeleteRecipeCategory(RecipeCategory recipeCategory)
        {
            if ((recipeCategory.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(recipeCategory, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.RecipeCategories.Attach(recipeCategory);
                this.ObjectContext.RecipeCategories.DeleteObject(recipeCategory);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'RecipeImages' query.
        [Query(IsDefault = true)]
        public IQueryable<RecipeImage> GetRecipeImages()
        {
            return this.ObjectContext.RecipeImages;
        }

        public void InsertRecipeImage(RecipeImage recipeImage)
        {
            if ((recipeImage.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(recipeImage, EntityState.Added);
            }
            else
            {
                this.ObjectContext.RecipeImages.AddObject(recipeImage);
            }
        }

        public void UpdateRecipeImage(RecipeImage currentRecipeImage)
        {
            this.ObjectContext.RecipeImages.AttachAsModified(currentRecipeImage, this.ChangeSet.GetOriginal(currentRecipeImage));
        }

        public void DeleteRecipeImage(RecipeImage recipeImage)
        {
            if ((recipeImage.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(recipeImage, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.RecipeImages.Attach(recipeImage);
                this.ObjectContext.RecipeImages.DeleteObject(recipeImage);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'RecipeIndgredients' query.
        [Query(IsDefault = true)]
        public IQueryable<RecipeIndgredient> GetRecipeIndgredients()
        {
            return this.ObjectContext.RecipeIndgredients;
        }

        public void InsertRecipeIndgredient(RecipeIndgredient recipeIndgredient)
        {
            if ((recipeIndgredient.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(recipeIndgredient, EntityState.Added);
            }
            else
            {
                this.ObjectContext.RecipeIndgredients.AddObject(recipeIndgredient);
            }
        }

        public void UpdateRecipeIndgredient(RecipeIndgredient currentRecipeIndgredient)
        {
            this.ObjectContext.RecipeIndgredients.AttachAsModified(currentRecipeIndgredient, this.ChangeSet.GetOriginal(currentRecipeIndgredient));
        }

        public void DeleteRecipeIndgredient(RecipeIndgredient recipeIndgredient)
        {
            if ((recipeIndgredient.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(recipeIndgredient, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.RecipeIndgredients.Attach(recipeIndgredient);
                this.ObjectContext.RecipeIndgredients.DeleteObject(recipeIndgredient);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'RecipeLikes' query.
        [Query(IsDefault = true)]
        public IQueryable<RecipeLike> GetRecipeLikes()
        {
            return this.ObjectContext.RecipeLikes;
        }

        public void InsertRecipeLike(RecipeLike recipeLike)
        {
            if ((recipeLike.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(recipeLike, EntityState.Added);
            }
            else
            {
                this.ObjectContext.RecipeLikes.AddObject(recipeLike);
            }
        }

        public void UpdateRecipeLike(RecipeLike currentRecipeLike)
        {
            this.ObjectContext.RecipeLikes.AttachAsModified(currentRecipeLike, this.ChangeSet.GetOriginal(currentRecipeLike));
        }

        public void DeleteRecipeLike(RecipeLike recipeLike)
        {
            if ((recipeLike.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(recipeLike, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.RecipeLikes.Attach(recipeLike);
                this.ObjectContext.RecipeLikes.DeleteObject(recipeLike);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'RecipeReads' query.
        [Query(IsDefault = true)]
        public IQueryable<RecipeRead> GetRecipeReads()
        {
            return this.ObjectContext.RecipeReads;
        }

        public void InsertRecipeRead(RecipeRead recipeRead)
        {
            if ((recipeRead.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(recipeRead, EntityState.Added);
            }
            else
            {
                this.ObjectContext.RecipeReads.AddObject(recipeRead);
            }
        }

        public void UpdateRecipeRead(RecipeRead currentRecipeRead)
        {
            this.ObjectContext.RecipeReads.AttachAsModified(currentRecipeRead, this.ChangeSet.GetOriginal(currentRecipeRead));
        }

        public void DeleteRecipeRead(RecipeRead recipeRead)
        {
            if ((recipeRead.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(recipeRead, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.RecipeReads.Attach(recipeRead);
                this.ObjectContext.RecipeReads.DeleteObject(recipeRead);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'RecipeSteps' query.
        [Query(IsDefault = true)]
        public IQueryable<RecipeStep> GetRecipeSteps()
        {
            return this.ObjectContext.RecipeSteps;
        }

        public void InsertRecipeStep(RecipeStep recipeStep)
        {
            if ((recipeStep.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(recipeStep, EntityState.Added);
            }
            else
            {
                this.ObjectContext.RecipeSteps.AddObject(recipeStep);
            }
        }

        public void UpdateRecipeStep(RecipeStep currentRecipeStep)
        {
            this.ObjectContext.RecipeSteps.AttachAsModified(currentRecipeStep, this.ChangeSet.GetOriginal(currentRecipeStep));
        }

        public void DeleteRecipeStep(RecipeStep recipeStep)
        {
            if ((recipeStep.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(recipeStep, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.RecipeSteps.Attach(recipeStep);
                this.ObjectContext.RecipeSteps.DeleteObject(recipeStep);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Restaurants' query.
        [Query(IsDefault = true)]
        public IQueryable<Restaurant> GetRestaurants()
        {
            return this.ObjectContext.Restaurants;
        }

        public void InsertRestaurant(Restaurant restaurant)
        {
            if ((restaurant.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(restaurant, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Restaurants.AddObject(restaurant);
            }
        }

        public void UpdateRestaurant(Restaurant currentRestaurant)
        {
            this.ObjectContext.Restaurants.AttachAsModified(currentRestaurant, this.ChangeSet.GetOriginal(currentRestaurant));
        }

        public void DeleteRestaurant(Restaurant restaurant)
        {
            if ((restaurant.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(restaurant, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Restaurants.Attach(restaurant);
                this.ObjectContext.Restaurants.DeleteObject(restaurant);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'RestaurantBranches' query.
        [Query(IsDefault = true)]
        public IQueryable<RestaurantBranch> GetRestaurantBranches()
        {
            return this.ObjectContext.RestaurantBranches;
        }

        public void InsertRestaurantBranch(RestaurantBranch restaurantBranch)
        {
            if ((restaurantBranch.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(restaurantBranch, EntityState.Added);
            }
            else
            {
                this.ObjectContext.RestaurantBranches.AddObject(restaurantBranch);
            }
        }

        public void UpdateRestaurantBranch(RestaurantBranch currentRestaurantBranch)
        {
            this.ObjectContext.RestaurantBranches.AttachAsModified(currentRestaurantBranch, this.ChangeSet.GetOriginal(currentRestaurantBranch));
        }

        public void DeleteRestaurantBranch(RestaurantBranch restaurantBranch)
        {
            if ((restaurantBranch.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(restaurantBranch, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.RestaurantBranches.Attach(restaurantBranch);
                this.ObjectContext.RestaurantBranches.DeleteObject(restaurantBranch);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'RestaurantFoods' query.
        [Query(IsDefault = true)]
        public IQueryable<RestaurantFood> GetRestaurantFoods()
        {
            return this.ObjectContext.RestaurantFoods;
        }

        public void InsertRestaurantFood(RestaurantFood restaurantFood)
        {
            if ((restaurantFood.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(restaurantFood, EntityState.Added);
            }
            else
            {
                this.ObjectContext.RestaurantFoods.AddObject(restaurantFood);
            }
        }

        public void UpdateRestaurantFood(RestaurantFood currentRestaurantFood)
        {
            this.ObjectContext.RestaurantFoods.AttachAsModified(currentRestaurantFood, this.ChangeSet.GetOriginal(currentRestaurantFood));
        }

        public void DeleteRestaurantFood(RestaurantFood restaurantFood)
        {
            if ((restaurantFood.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(restaurantFood, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.RestaurantFoods.Attach(restaurantFood);
                this.ObjectContext.RestaurantFoods.DeleteObject(restaurantFood);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Roles' query.
        [Query(IsDefault = true)]
        public IQueryable<Role> GetRoles()
        {
            return this.ObjectContext.Roles;
        }

        public void InsertRole(Role role)
        {
            if ((role.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(role, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Roles.AddObject(role);
            }
        }

        public void UpdateRole(Role currentRole)
        {
            this.ObjectContext.Roles.AttachAsModified(currentRole, this.ChangeSet.GetOriginal(currentRole));
        }

        public void DeleteRole(Role role)
        {
            if ((role.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(role, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Roles.Attach(role);
                this.ObjectContext.Roles.DeleteObject(role);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Shoppings' query.
        [Query(IsDefault = true)]
        public IQueryable<Shopping> GetShoppings()
        {
            return this.ObjectContext.Shoppings;
        }

        public void InsertShopping(Shopping shopping)
        {
            if ((shopping.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(shopping, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Shoppings.AddObject(shopping);
            }
        }

        public void UpdateShopping(Shopping currentShopping)
        {
            this.ObjectContext.Shoppings.AttachAsModified(currentShopping, this.ChangeSet.GetOriginal(currentShopping));
        }

        public void DeleteShopping(Shopping shopping)
        {
            if ((shopping.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(shopping, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Shoppings.Attach(shopping);
                this.ObjectContext.Shoppings.DeleteObject(shopping);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'ShoppingCarts' query.
        [Query(IsDefault = true)]
        public IQueryable<ShoppingCart> GetShoppingCarts()
        {
            return this.ObjectContext.ShoppingCarts;
        }

        public void InsertShoppingCart(ShoppingCart shoppingCart)
        {
            if ((shoppingCart.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(shoppingCart, EntityState.Added);
            }
            else
            {
                this.ObjectContext.ShoppingCarts.AddObject(shoppingCart);
            }
        }

        public void UpdateShoppingCart(ShoppingCart currentShoppingCart)
        {
            this.ObjectContext.ShoppingCarts.AttachAsModified(currentShoppingCart, this.ChangeSet.GetOriginal(currentShoppingCart));
        }

        public void DeleteShoppingCart(ShoppingCart shoppingCart)
        {
            if ((shoppingCart.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(shoppingCart, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.ShoppingCarts.Attach(shoppingCart);
                this.ObjectContext.ShoppingCarts.DeleteObject(shoppingCart);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Sleeps' query.
        [Query(IsDefault = true)]
        public IQueryable<Sleep> GetSleeps()
        {
            return this.ObjectContext.Sleeps;
        }

        public void InsertSleep(Sleep sleep)
        {
            if ((sleep.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(sleep, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Sleeps.AddObject(sleep);
            }
        }

        public void UpdateSleep(Sleep currentSleep)
        {
            this.ObjectContext.Sleeps.AttachAsModified(currentSleep, this.ChangeSet.GetOriginal(currentSleep));
        }

        public void DeleteSleep(Sleep sleep)
        {
            if ((sleep.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(sleep, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Sleeps.Attach(sleep);
                this.ObjectContext.Sleeps.DeleteObject(sleep);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'sysdiagrams' query.
        [Query(IsDefault = true)]
        public IQueryable<sysdiagram> GetSysdiagrams()
        {
            return this.ObjectContext.sysdiagrams;
        }

        public void InsertSysdiagram(sysdiagram sysdiagram)
        {
            if ((sysdiagram.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(sysdiagram, EntityState.Added);
            }
            else
            {
                this.ObjectContext.sysdiagrams.AddObject(sysdiagram);
            }
        }

        public void UpdateSysdiagram(sysdiagram currentsysdiagram)
        {
            this.ObjectContext.sysdiagrams.AttachAsModified(currentsysdiagram, this.ChangeSet.GetOriginal(currentsysdiagram));
        }

        public void DeleteSysdiagram(sysdiagram sysdiagram)
        {
            if ((sysdiagram.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(sysdiagram, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.sysdiagrams.Attach(sysdiagram);
                this.ObjectContext.sysdiagrams.DeleteObject(sysdiagram);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'TemperatureDiaries' query.
        [Query(IsDefault = true)]
        public IQueryable<TemperatureDiary> GetTemperatureDiaries()
        {
            return this.ObjectContext.TemperatureDiaries;
        }

        public void InsertTemperatureDiary(TemperatureDiary temperatureDiary)
        {
            if ((temperatureDiary.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(temperatureDiary, EntityState.Added);
            }
            else
            {
                this.ObjectContext.TemperatureDiaries.AddObject(temperatureDiary);
            }
        }

        public void UpdateTemperatureDiary(TemperatureDiary currentTemperatureDiary)
        {
            this.ObjectContext.TemperatureDiaries.AttachAsModified(currentTemperatureDiary, this.ChangeSet.GetOriginal(currentTemperatureDiary));
        }

        public void DeleteTemperatureDiary(TemperatureDiary temperatureDiary)
        {
            if ((temperatureDiary.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(temperatureDiary, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.TemperatureDiaries.Attach(temperatureDiary);
                this.ObjectContext.TemperatureDiaries.DeleteObject(temperatureDiary);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Tips' query.
        [Query(IsDefault = true)]
        public IQueryable<Tip> GetTips()
        {
            return this.ObjectContext.Tips;
        }

        public void InsertTip(Tip tip)
        {
            if ((tip.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(tip, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Tips.AddObject(tip);
            }
        }

        public void UpdateTip(Tip currentTip)
        {
            this.ObjectContext.Tips.AttachAsModified(currentTip, this.ChangeSet.GetOriginal(currentTip));
        }

        public void DeleteTip(Tip tip)
        {
            if ((tip.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(tip, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Tips.Attach(tip);
                this.ObjectContext.Tips.DeleteObject(tip);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'TipCategories' query.
        [Query(IsDefault = true)]
        public IQueryable<TipCategory> GetTipCategories()
        {
            return this.ObjectContext.TipCategories;
        }

        public void InsertTipCategory(TipCategory tipCategory)
        {
            if ((tipCategory.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(tipCategory, EntityState.Added);
            }
            else
            {
                this.ObjectContext.TipCategories.AddObject(tipCategory);
            }
        }

        public void UpdateTipCategory(TipCategory currentTipCategory)
        {
            this.ObjectContext.TipCategories.AttachAsModified(currentTipCategory, this.ChangeSet.GetOriginal(currentTipCategory));
        }

        public void DeleteTipCategory(TipCategory tipCategory)
        {
            if ((tipCategory.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(tipCategory, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.TipCategories.Attach(tipCategory);
                this.ObjectContext.TipCategories.DeleteObject(tipCategory);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'TipsLikes' query.
        [Query(IsDefault = true)]
        public IQueryable<TipsLike> GetTipsLikes()
        {
            return this.ObjectContext.TipsLikes;
        }

        public void InsertTipsLike(TipsLike tipsLike)
        {
            if ((tipsLike.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(tipsLike, EntityState.Added);
            }
            else
            {
                this.ObjectContext.TipsLikes.AddObject(tipsLike);
            }
        }

        public void UpdateTipsLike(TipsLike currentTipsLike)
        {
            this.ObjectContext.TipsLikes.AttachAsModified(currentTipsLike, this.ChangeSet.GetOriginal(currentTipsLike));
        }

        public void DeleteTipsLike(TipsLike tipsLike)
        {
            if ((tipsLike.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(tipsLike, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.TipsLikes.Attach(tipsLike);
                this.ObjectContext.TipsLikes.DeleteObject(tipsLike);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'TipVieweds' query.
        [Query(IsDefault = true)]
        public IQueryable<TipViewed> GetTipVieweds()
        {
            return this.ObjectContext.TipVieweds;
        }

        public void InsertTipViewed(TipViewed tipViewed)
        {
            if ((tipViewed.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(tipViewed, EntityState.Added);
            }
            else
            {
                this.ObjectContext.TipVieweds.AddObject(tipViewed);
            }
        }

        public void UpdateTipViewed(TipViewed currentTipViewed)
        {
            this.ObjectContext.TipVieweds.AttachAsModified(currentTipViewed, this.ChangeSet.GetOriginal(currentTipViewed));
        }

        public void DeleteTipViewed(TipViewed tipViewed)
        {
            if ((tipViewed.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(tipViewed, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.TipVieweds.Attach(tipViewed);
                this.ObjectContext.TipVieweds.DeleteObject(tipViewed);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Travels' query.
        [Query(IsDefault = true)]
        public IQueryable<Travel> GetTravels()
        {
            return this.ObjectContext.Travels;
        }

        public void InsertTravel(Travel travel)
        {
            if ((travel.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(travel, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Travels.AddObject(travel);
            }
        }

        public void UpdateTravel(Travel currentTravel)
        {
            this.ObjectContext.Travels.AttachAsModified(currentTravel, this.ChangeSet.GetOriginal(currentTravel));
        }

        public void DeleteTravel(Travel travel)
        {
            if ((travel.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(travel, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Travels.Attach(travel);
                this.ObjectContext.Travels.DeleteObject(travel);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'TravelTypes' query.
        [Query(IsDefault = true)]
        public IQueryable<TravelType> GetTravelTypes()
        {
            return this.ObjectContext.TravelTypes;
        }

        public void InsertTravelType(TravelType travelType)
        {
            if ((travelType.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(travelType, EntityState.Added);
            }
            else
            {
                this.ObjectContext.TravelTypes.AddObject(travelType);
            }
        }

        public void UpdateTravelType(TravelType currentTravelType)
        {
            this.ObjectContext.TravelTypes.AttachAsModified(currentTravelType, this.ChangeSet.GetOriginal(currentTravelType));
        }

        public void DeleteTravelType(TravelType travelType)
        {
            if ((travelType.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(travelType, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.TravelTypes.Attach(travelType);
                this.ObjectContext.TravelTypes.DeleteObject(travelType);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Urinations' query.
        [Query(IsDefault = true)]
        public IQueryable<Urination> GetUrinations()
        {
            return this.ObjectContext.Urinations;
        }

        public void InsertUrination(Urination urination)
        {
            if ((urination.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(urination, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Urinations.AddObject(urination);
            }
        }

        public void UpdateUrination(Urination currentUrination)
        {
            this.ObjectContext.Urinations.AttachAsModified(currentUrination, this.ChangeSet.GetOriginal(currentUrination));
        }

        public void DeleteUrination(Urination urination)
        {
            if ((urination.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(urination, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Urinations.Attach(urination);
                this.ObjectContext.Urinations.DeleteObject(urination);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Users' query.
        [Query(IsDefault = true)]
        public IQueryable<User> GetUsers()
        {
            return this.ObjectContext.Users;
        }

        public void InsertUser(User user)
        {
            if ((user.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(user, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Users.AddObject(user);
            }
        }

        public void UpdateUser(User currentUser)
        {
            this.ObjectContext.Users.AttachAsModified(currentUser, this.ChangeSet.GetOriginal(currentUser));
        }

        public void DeleteUser(User user)
        {
            if ((user.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(user, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Users.Attach(user);
                this.ObjectContext.Users.DeleteObject(user);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'UserFoodFavs' query.
        [Query(IsDefault = true)]
        public IQueryable<UserFoodFav> GetUserFoodFavs()
        {
            return this.ObjectContext.UserFoodFavs;
        }

        public void InsertUserFoodFav(UserFoodFav userFoodFav)
        {
            if ((userFoodFav.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(userFoodFav, EntityState.Added);
            }
            else
            {
                this.ObjectContext.UserFoodFavs.AddObject(userFoodFav);
            }
        }

        public void UpdateUserFoodFav(UserFoodFav currentUserFoodFav)
        {
            this.ObjectContext.UserFoodFavs.AttachAsModified(currentUserFoodFav, this.ChangeSet.GetOriginal(currentUserFoodFav));
        }

        public void DeleteUserFoodFav(UserFoodFav userFoodFav)
        {
            if ((userFoodFav.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(userFoodFav, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.UserFoodFavs.Attach(userFoodFav);
                this.ObjectContext.UserFoodFavs.DeleteObject(userFoodFav);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'UserFoodIngredientFavs' query.
        [Query(IsDefault = true)]
        public IQueryable<UserFoodIngredientFav> GetUserFoodIngredientFavs()
        {
            return this.ObjectContext.UserFoodIngredientFavs;
        }

        public void InsertUserFoodIngredientFav(UserFoodIngredientFav userFoodIngredientFav)
        {
            if ((userFoodIngredientFav.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(userFoodIngredientFav, EntityState.Added);
            }
            else
            {
                this.ObjectContext.UserFoodIngredientFavs.AddObject(userFoodIngredientFav);
            }
        }

        public void UpdateUserFoodIngredientFav(UserFoodIngredientFav currentUserFoodIngredientFav)
        {
            this.ObjectContext.UserFoodIngredientFavs.AttachAsModified(currentUserFoodIngredientFav, this.ChangeSet.GetOriginal(currentUserFoodIngredientFav));
        }

        public void DeleteUserFoodIngredientFav(UserFoodIngredientFav userFoodIngredientFav)
        {
            if ((userFoodIngredientFav.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(userFoodIngredientFav, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.UserFoodIngredientFavs.Attach(userFoodIngredientFav);
                this.ObjectContext.UserFoodIngredientFavs.DeleteObject(userFoodIngredientFav);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'UserMeals' query.
        [Query(IsDefault = true)]
        public IQueryable<UserMeal> GetUserMeals()
        {
            return this.ObjectContext.UserMeals;
        }

        public void InsertUserMeal(UserMeal userMeal)
        {
            if ((userMeal.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(userMeal, EntityState.Added);
            }
            else
            {
                this.ObjectContext.UserMeals.AddObject(userMeal);
            }
        }

        public void UpdateUserMeal(UserMeal currentUserMeal)
        {
            this.ObjectContext.UserMeals.AttachAsModified(currentUserMeal, this.ChangeSet.GetOriginal(currentUserMeal));
        }

        public void DeleteUserMeal(UserMeal userMeal)
        {
            if ((userMeal.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(userMeal, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.UserMeals.Attach(userMeal);
                this.ObjectContext.UserMeals.DeleteObject(userMeal);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'UserMealFavs' query.
        [Query(IsDefault = true)]
        public IQueryable<UserMealFav> GetUserMealFavs()
        {
            return this.ObjectContext.UserMealFavs;
        }

        public void InsertUserMealFav(UserMealFav userMealFav)
        {
            if ((userMealFav.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(userMealFav, EntityState.Added);
            }
            else
            {
                this.ObjectContext.UserMealFavs.AddObject(userMealFav);
            }
        }

        public void UpdateUserMealFav(UserMealFav currentUserMealFav)
        {
            this.ObjectContext.UserMealFavs.AttachAsModified(currentUserMealFav, this.ChangeSet.GetOriginal(currentUserMealFav));
        }

        public void DeleteUserMealFav(UserMealFav userMealFav)
        {
            if ((userMealFav.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(userMealFav, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.UserMealFavs.Attach(userMealFav);
                this.ObjectContext.UserMealFavs.DeleteObject(userMealFav);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'UserPregnancyProblems' query.
        [Query(IsDefault = true)]
        public IQueryable<UserPregnancyProblem> GetUserPregnancyProblems()
        {
            return this.ObjectContext.UserPregnancyProblems;
        }

        public void InsertUserPregnancyProblem(UserPregnancyProblem userPregnancyProblem)
        {
            if ((userPregnancyProblem.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(userPregnancyProblem, EntityState.Added);
            }
            else
            {
                this.ObjectContext.UserPregnancyProblems.AddObject(userPregnancyProblem);
            }
        }

        public void UpdateUserPregnancyProblem(UserPregnancyProblem currentUserPregnancyProblem)
        {
            this.ObjectContext.UserPregnancyProblems.AttachAsModified(currentUserPregnancyProblem, this.ChangeSet.GetOriginal(currentUserPregnancyProblem));
        }

        public void DeleteUserPregnancyProblem(UserPregnancyProblem userPregnancyProblem)
        {
            if ((userPregnancyProblem.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(userPregnancyProblem, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.UserPregnancyProblems.Attach(userPregnancyProblem);
                this.ObjectContext.UserPregnancyProblems.DeleteObject(userPregnancyProblem);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'UserProfiles' query.
        [Query(IsDefault = true)]
        public IQueryable<UserProfile> GetUserProfiles()
        {
            return this.ObjectContext.UserProfiles;
        }

        public void InsertUserProfile(UserProfile userProfile)
        {
            if ((userProfile.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(userProfile, EntityState.Added);
            }
            else
            {
                this.ObjectContext.UserProfiles.AddObject(userProfile);
            }
        }

        public void UpdateUserProfile(UserProfile currentUserProfile)
        {
            this.ObjectContext.UserProfiles.AttachAsModified(currentUserProfile, this.ChangeSet.GetOriginal(currentUserProfile));
        }

        public void DeleteUserProfile(UserProfile userProfile)
        {
            if ((userProfile.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(userProfile, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.UserProfiles.Attach(userProfile);
                this.ObjectContext.UserProfiles.DeleteObject(userProfile);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'UserTipCategories' query.
        [Query(IsDefault = true)]
        public IQueryable<UserTipCategory> GetUserTipCategories()
        {
            return this.ObjectContext.UserTipCategories;
        }

        public void InsertUserTipCategory(UserTipCategory userTipCategory)
        {
            if ((userTipCategory.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(userTipCategory, EntityState.Added);
            }
            else
            {
                this.ObjectContext.UserTipCategories.AddObject(userTipCategory);
            }
        }

        public void UpdateUserTipCategory(UserTipCategory currentUserTipCategory)
        {
            this.ObjectContext.UserTipCategories.AttachAsModified(currentUserTipCategory, this.ChangeSet.GetOriginal(currentUserTipCategory));
        }

        public void DeleteUserTipCategory(UserTipCategory userTipCategory)
        {
            if ((userTipCategory.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(userTipCategory, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.UserTipCategories.Attach(userTipCategory);
                this.ObjectContext.UserTipCategories.DeleteObject(userTipCategory);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'UserTipCategoryIDs' query.
        [Query(IsDefault = true)]
        public IQueryable<UserTipCategoryID> GetUserTipCategoryIDs()
        {
            return this.ObjectContext.UserTipCategoryIDs;
        }

        public void InsertUserTipCategoryID(UserTipCategoryID userTipCategoryID)
        {
            if ((userTipCategoryID.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(userTipCategoryID, EntityState.Added);
            }
            else
            {
                this.ObjectContext.UserTipCategoryIDs.AddObject(userTipCategoryID);
            }
        }

        public void UpdateUserTipCategoryID(UserTipCategoryID currentUserTipCategoryID)
        {
            this.ObjectContext.UserTipCategoryIDs.AttachAsModified(currentUserTipCategoryID, this.ChangeSet.GetOriginal(currentUserTipCategoryID));
        }

        public void DeleteUserTipCategoryID(UserTipCategoryID userTipCategoryID)
        {
            if ((userTipCategoryID.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(userTipCategoryID, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.UserTipCategoryIDs.Attach(userTipCategoryID);
                this.ObjectContext.UserTipCategoryIDs.DeleteObject(userTipCategoryID);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'WeightCategories' query.
        [Query(IsDefault = true)]
        public IQueryable<WeightCategory> GetWeightCategories()
        {
            return this.ObjectContext.WeightCategories;
        }

        public void InsertWeightCategory(WeightCategory weightCategory)
        {
            if ((weightCategory.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(weightCategory, EntityState.Added);
            }
            else
            {
                this.ObjectContext.WeightCategories.AddObject(weightCategory);
            }
        }

        public void UpdateWeightCategory(WeightCategory currentWeightCategory)
        {
            this.ObjectContext.WeightCategories.AttachAsModified(currentWeightCategory, this.ChangeSet.GetOriginal(currentWeightCategory));
        }

        public void DeleteWeightCategory(WeightCategory weightCategory)
        {
            if ((weightCategory.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(weightCategory, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.WeightCategories.Attach(weightCategory);
                this.ObjectContext.WeightCategories.DeleteObject(weightCategory);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'WeightDiaries' query.
        [Query(IsDefault = true)]
        public IQueryable<WeightDiary> GetWeightDiaries()
        {
            return this.ObjectContext.WeightDiaries;
        }

        public void InsertWeightDiary(WeightDiary weightDiary)
        {
            if ((weightDiary.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(weightDiary, EntityState.Added);
            }
            else
            {
                this.ObjectContext.WeightDiaries.AddObject(weightDiary);
            }
        }

        public void UpdateWeightDiary(WeightDiary currentWeightDiary)
        {
            this.ObjectContext.WeightDiaries.AttachAsModified(currentWeightDiary, this.ChangeSet.GetOriginal(currentWeightDiary));
        }

        public void DeleteWeightDiary(WeightDiary weightDiary)
        {
            if ((weightDiary.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(weightDiary, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.WeightDiaries.Attach(weightDiary);
                this.ObjectContext.WeightDiaries.DeleteObject(weightDiary);
            }
        }
    }
}


